package org.dtrd.modules.device.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.dtrd.modules.device.entity.bean.DevicePushContentDetail;

import java.util.Date;


/**
 * <p>
 * 智能设备推送记录
 * </p>
 *
 * @author xiao
 * @since 2022-01-12
 */
@Data
@TableName("dtrd_ent_rd_device_push_content")
public class DtrdEntRdDevicePushContent {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("create_time")
    private Date createTime;

    /**
     * 消息ID
     */
    @TableField("msg_id")
    private String msgId;

    /**
     * 推送内容
     */
    @TableField("push_content")
    private String pushContent;

    /**
     * 设备序列号
     */
    @TableField("device_sn")
    private String deviceSn;

    /**
     * 设备品牌  1小糖医  2 爱奥乐  3 微策
     */
    @TableField("device_brand")
    private Integer deviceBrand;

    /**
     * 设备种类  1 血糖仪 2 血压计
     */
    @TableField("device_category")
    private Integer deviceCategory;

    public DtrdEntRdDevicePushContent init() {
        createTime = new Date();
        return this;
    }

    public DtrdEntRdDevicePushContent parseFromDto(DevicePushContentDetail dto) {
        dataId = dto.getDataId();
        msgId = dto.getMsgId();
        pushContent = dto.getPushContent();
        deviceSn = dto.getDeviceSn();
        deviceCategory = dto.getDeviceCategory();
        deviceBrand = dto.getDeviceBrand();
        return this;
    }


}
